<?php
class Home_Controller extends Controller {
    function index() {
        $config = Load::model( 'config' );
        
        /*$image = Load::plugin( 'image' );
        $image -> load( STATIC_PATH . 'image.jpg' );
        $image -> resize( 128, 96 );
        $image -> rotate( 30 );
        $image -> save( STATIC_PATH . 'image_r.jpg' );
        
        $bbcode = Load::plugin( 'bbcode' );
        $bbcode -> setConfig( 'bbcodes', Config::get( 'bbcodes_list', 'config' ) );
        $bbcode -> setText( '[b][u][i]to jest test[/u] pogrubiony[/b][i] [color="red"]a to już [font="georgia"][size="25"]nie jest[/size][/font][/color] pogrubione' );
        $bbcode -> cutText( 135 );
        $bbcode -> parse( );
        */
        $menu = Load::model( 'menu' );
        $view = View::factory('index.php');
        $view -> assign( 'title', $config -> get( 'title' ) );
        $view -> assign( 'scripts', $config -> getScripts() );
        $view -> assign( 'menu', $menu -> getAll() );
        $view -> render();
    }
    
    /*function captcha() {
        $image = Load::plugin( 'image' );
        $chars = 'abcdefghijklmnopqrstuvwxyz';
        $key = '';
        for( $i = 0; $i < 6; $i++ ) {
            $key .= $chars[ rand( 0, 25 ) ];
        }
        $this -> session -> set( 'captcha', $image -> generate_token( $key, 120, 30, 20, 35, true, STATIC_PATH . 'fonts/token_font.ttf', 25 ) );
    }*/
}